package com.linked.pay.pay.bean.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linked.universal.bean.pay.param.WaitingPayCreateParam;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author :dbq
 * @date : 2023/3/2 14:45
 * @description : desc
 */
@TableName("pay_pay_info")
@Data
public class PayInfoPO {
    @TableId(value = "pay_id", type = IdType.ASSIGN_UUID)
    private String payId;
    @TableField("order_id")
    private String orderId;

    @TableField("user_id")
    private String userId;
    @TableField("money_amount")
    private Double moneyAmount;
    @TableField("real_amount")
    private Double realAmount;
    @TableField("pay_status")
    private Integer payStatus;
    @TableField("coupon_id")
    private String couponId;
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @TableField("pay_way_id")
    private String payWayId;
    @TableField("points_amount")
    private Integer pointsAmount;

    public PayInfoPO(WaitingPayCreateParam param) {
        this.orderId = param.getOrderId();
        this.userId = param.getUserId();
        this.moneyAmount = param.getMoneyAmount();
        this.payStatus = 1;
    }

    public PayInfoPO() {
    }
}
